package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.AppDynamicDianzanDao;
import com.vf.admin.client.service.AppDynamicDianzanService;
import com.vf.admin.miaodong.entity.AppDynamicDianzan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class AppDynamicDianzanServiceImpl implements AppDynamicDianzanService {

    @Autowired
    AppDynamicDianzanDao appDynamicDianzanDao;

    @Override
    public void save(AppDynamicDianzan appDynamic) {
        appDynamicDianzanDao.save(appDynamic);
    }

    @Override
    public void dynamicSave(Integer dongtaiId,String nick,String pic,String phone,Integer userid) {
        AppDynamicDianzan dianzans = new AppDynamicDianzan();
        dianzans.setCreatetime(new Date());
        dianzans.setDynamicid(dongtaiId);
        dianzans.setNick(nick);
        dianzans.setPic(pic);
        dianzans.setPhone(phone);
        dianzans.setUserid(userid);
        appDynamicDianzanDao.save(dianzans);
    }

    @Override
    public AppDynamicDianzan get(Integer id) {
        return appDynamicDianzanDao.get(id);
    }

    @Override
    public AppDynamicDianzan getSpecifiedLike(Integer userid,Integer dynamicid) {
        return appDynamicDianzanDao.getSpecifiedLike(userid, dynamicid);
    }

    @Override
    public List<AppDynamicDianzan> count(Integer dynamicId) {
        return appDynamicDianzanDao.count(dynamicId);
    }

    @Override
    public List<AppDynamicDianzan> getPiliang(Integer userid, String arr) {
        return appDynamicDianzanDao.getPiliang(userid, arr);
    }

    @Override
    public void del(Integer id) {
        appDynamicDianzanDao.del(id);
    }
}
